var vue = new Vue({
  el: '#app',
  data: {
    multipleSelection: [],
    title: '',
    meetingData: [],
    totalSize: 0,
    pageIndex: 1,
    pageSize: 10

  },
  created: function() {
  },
  mounted() {
    this.initGrid()

  },

  methods: {

    // 删除
    exportSummart: function(rid) {
      if (this.multipleSelection.length != 1) {
        this.$message({
          showClose: true,
          message: '请选择一条数据',
          type: 'warning'
        })
        return false
      }
      var id = this.multipleSelection[0].id
      if (confirm('确定删除吗')) {
        var that = this
        $.post('weekMeeting/exportSummary', {
          id: id
        }, function(result) {
          if (result.data) {
            that.$message({
              message: '导出成功',
              type: 'success'
            })
            that.initGrid()
          } else {
            that.$message({
              message: '导出失败',
              type: 'warning'
            })
          }
        })
      }
    },
    // 初始化表格
    initGrid: function() {
      var that = this
      $.post('weekMeeting/listByPageByDate', {
        index: that.pageIndex,
        size: that.pageSize
      }, function(result) {
        console.log(result)
        that.totalSize = result.data.total
        that.meetingData = result.data.data
      })
    },
    //翻页
    handleSizeChange(val) {
      this.pageSize = val
      this.initGrid()
    },
    //改变每页显示条数
    handleCurrentChange(val) {
      this.pageIndex = val
      this.initGrid()
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    }
  }
})
